package main;

import processing.core.PApplet;

public class DrawTarget extends PApplet {

    @Override
    public void settings() {
        size(640, 360);
    }

    @Override
    public void setup() {
        background(51);
        noStroke();
        noLoop();
    }

    @Override
    public void draw() {
        drawTarget(width* 0.25f, height* 0.4f, 200, 40);
        drawTarget(width* 0.5f, height* 0.5f, 300, 100);
        drawTarget(width* 0.75f, height* 0.3f, 120, 60);
    }

    public void drawTarget(float xloc, float yloc, int size, int num) {
        float grayValues = 255/num;
        float steps = size/ num;

        for(int i = 0; i < num; i++) {
            fill(i * grayValues);
            ellipse(xloc, yloc, size - i * steps, size - i * steps);
        }
    }
}
